/*=================================页面load============================================================*/

function pageLoad(){
	createLeftTopMenu();
	queryAllSettings();
	var title = getQueryString("title");
	var category = getQueryString("category");
	document.getElementById("category").innerHTML = getQueryString("category");
	document.getElementById("title").innerHTML = getQueryString("title");
	document.title = category + " - " + title;
	querySettings();
}

/*=================================信息获取============================================================*/

//获取信息
function querySettings(){
	if(bXmlHttpSupport) {
    	var sUrl = "queryHotlineNote.action";
    	var params ="";
        var request = new XMLHttpRequest();
        request.onreadystatechange = function() {
        	if(request.readyState == 4) {
            	var oRequest = eval('(' + request.responseText + ')');
            	//alert(request.responseText);
            	var settingsList = oRequest.settingsList;
            	putSettings(settingsList);
			}
    	};
    	request.open('POST', sUrl);
    	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
    	request.send(params);
    }
}

/*=================================信息展示============================================================*/

//行业动态页面，生成左上角的目录
function createLeftTopMenu(){
	var item = getQueryString("item");
	if(bXmlHttpSupport) {
    	var sUrl = "findSettings.action";
    	var params ="item=LeftTopMenu&setKey=" + item;
        var request = new XMLHttpRequest();
        request.onreadystatechange = function() {
        	if(request.readyState == 4) {
            	var oRequest = eval('(' + request.responseText + ')');
            	//alert(request.responseText);
            	var string = oRequest.settings.setValue;
            	news.innerHTML = string;
			}
    	};
    	request.open('POST', sUrl);
    	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
    	request.send(params);
    }
}

/*=================================数据处理============================================================*/
//将信息展示出来
function putSettings(settingsList){
	var rowlength = tbBody.rows.length; 
    for(var i=0;i <rowlength;i++) {
    	tbBody.deleteRow(0); 
    }
	for (var i = 0; i < settingsList.length - 1; i++){
		var rowObj = document.createElement("tr");
		addOneTD(rowObj, settingsList[i][4], "");
		addOneTD(rowObj, settingsList[i][3], "");
		tbBody.appendChild(rowObj);
	}
}